package com.guojunyu.exp3.demo.conf;

import com.guojunyu.exp3.demo.service.EpidemicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@Component
public class UpdateTask {

    @Autowired
    EpidemicService epidemicService;

    @Scheduled(cron = "${cron}")
    public void updateEpidemicData() {
        epidemicService.getData();
    }

}
